package com.huluobo.a2206koltindouyin.mine

import androidx.lifecycle.MutableLiveData
import com.huluobo.base.bean.VideoBean
import com.huluobo.base.db.DouYinDatabase
import com.huluobo.base.mvvm.BaseViewModel
import com.huluobo.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 *  Created by LC on 2024/10/31.
 */
@HiltViewModel
class MineViewModel @Inject constructor(
    val apiService: ApiService,
    val db: DouYinDatabase
) : BaseViewModel() {
    val queryCollectSuccess by lazy { MutableLiveData<List<VideoBean>>() }
    fun queryCollectVideos() {
        executeDb(
            { db.getVideoDao().queryVideoInfo() },
            queryCollectSuccess::postValue
        )
    }
}